package com.baizhi.controller;


import com.baizhi.entity.AttrGroup;
import com.baizhi.service.IAttrGroupService;
import com.baizhi.vo.R;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 属性分组 前端控制器
 * </p>
 *
 * @author huiJie
 * @since 2021-08-31
 */
@RestController
@RequestMapping("/attrGroup")
public class AttrGroupController {
    @Autowired
    private IAttrGroupService attrGroupService;
    @GetMapping("{id}")
    public R showGroupsById(@PathVariable("id")Integer id){
        List<AttrGroup> attrGroups = attrGroupService.list(new QueryWrapper<AttrGroup>().eq("category_id", id));
        return R.ok(attrGroups);
    }
}

